package office.stock.messaging;

import javax.websocket.Session;

import office.stock.messaging.notifications.Notification;

public class WebsocketSubscriber {
    
    private Session session;
    
    public WebsocketSubscriber (Session session) {
	this.session = session;
    }
    
    public void notifyAsynchronously(Notification notification) {
	session.getAsyncRemote().sendText(notification.toString());
    }
    
    public String getId() {
	return session.getId();
    }
}
